# https://leetcode.cn/problems/permutation-difference-between-two-strings/description/


class Solution:
    def findPermutationDifference(self, s: str, t: str) -> int:
        ans = 0
        for i, v in enumerate(s):
            j = t.index(v)
            ans += abs(i - j)
        return ans